import urllib.request
import urllib.parse
from io import BytesIO
import sys
import gzip
from __init__ import Settings
# url = input('eolinker接口请求地址')
# if bool(url) == False:
#     url="https://sxkv.w.eolinker.com/apiManagementPro/Api/getApiListByCondition"
settings=Settings()
url = settings.url

data = {}
data["spaceKey"]="sxkv"
if bool(settings.projectHashKey) == True:
    data["projectHashKey"]=settings.projectHashKey
if bool(settings.shareCode) == True:
    data["shareCode"]=settings.shareCode
if bool(settings.shareID) == True:
    data["shareID"]=settings.shareID
if bool(settings.shareToken) == True:
    data["shareToken"]=settings.shareToken
data["groupID"]="-1"
data["orderBy"]="3"
data["asc"]="0"
data["pageSize"]="999"
data["page"]="1"
Cookie=settings.Cookie
data=urllib.parse.urlencode(data).encode('utf-8')
req=urllib.request.Request(url,data)
req.add_header("Content-Type","application/x-www-form-urlencoded;charset=UTF-8")
req.add_header("Referer","https://sxkv.w.eolinker.com/")
req.add_header("Accept-Encoding","gzip, deflate, br")
req.add_header("Accept-Language","zh-CN,zh;q=0.9")
req.add_header("Cookie",Cookie)
response=urllib.request.urlopen(req)
htmls=response.read()
buff = BytesIO(htmls)
f = gzip.GzipFile(fileobj=buff)
htmls = f.read().decode('utf-8')
class Htmls():
    """储存所有设置类"""
    def __init__(self):
        self==htmls